package com.jrx.anytxn.param.service.investor;

import com.jrx.anytxn.common.exception.TxnException;
import com.jrx.anytxn.i18n.response.TxnPage;
import com.jrx.anytxn.param.dto.investor.PrInvestorPenaltyRateReq;
import com.jrx.anytxn.param.dto.investor.PrInvestorPenaltyRateRes;
import com.jrx.anytxn.param.entity.PrInvestorPenaltyRate;

import java.math.BigDecimal;

/**
 * 出资方出资方罚息利率表 业务接口
 *
 * @author yx
 * @date 2019/4/30
 */
public interface IPrInvestorPenaltyRateService {

    /**
     * 根据租户Id分页查询出资方罚息利率表参数信息
     *
     * @param pageNum
     * @param pageSize
     * @param tenantId
     * @return
     * @throws TxnException
     */
    TxnPage<PrInvestorPenaltyRateRes> findAllPageByTenId(Integer pageNum, Integer pageSize, String tenantId) throws TxnException;

    /**
     * 添加出资方罚息利率表参数
     *
     * @param prInvestorPenaltyRateReq
     * @return
     * @throws TxnException
     */
    PrInvestorPenaltyRateRes addPenaltyRateTable(PrInvestorPenaltyRateReq prInvestorPenaltyRateReq) throws TxnException;

    /**
     * 更新出资方罚息利率表参数
     *
     * @param prInvestorPenaltyRateReq
     * @return
     * @throws TxnException
     */
    PrInvestorPenaltyRateRes modifyPenaltyRateTable(PrInvestorPenaltyRateReq prInvestorPenaltyRateReq) throws TxnException;

    /**
     * 通过租户ID和出资方罚息利率表ID删除出资方罚息利率表参数
     *
     * @param tenantId
     * @param investorPenaltyId
     * @return
     * @throws TxnException
     */
    Boolean removeByTenIdAndPenaltyId(String tenantId, String investorPenaltyId) throws TxnException;

    /**
     * 通过租户ID和出资方罚息利率表ID查询出资方罚息利率表参数
     *
     * @param tenantId
     * @param investorPenaltyId
     * @return
     * @throws TxnException
     */
    PrInvestorPenaltyRateRes findByTenIdAndPenaltyId(String tenantId, String investorPenaltyId) throws TxnException;

    /**
     * 通过租户ID和出资方罚息利率表ID查询出资方罚息利率表参数
     *
     * @param tenantId
     * @param investorPenaltyId
     * @return
     * @throws TxnException
     */
    PrInvestorPenaltyRate findPrInvestorPenaltyRate(String tenantId, String investorPenaltyId) throws TxnException;

    /**
     * 获取罚息利率
     *
     * @param dailyRate
     * @param investorPenaltyRate
     * @return
     */
    BigDecimal getPenaltyDailyRate(BigDecimal dailyRate, PrInvestorPenaltyRate investorPenaltyRate);
}
